package cn.openea.perpartner.timeline.web.mapper;

import cn.openea.perpartner.timeline.web.entity.ArcTicket;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * (ArcTicket)表数据库访问层
 *
 * @author Weird077
 * @since 2022-12-11 22:16:28
 */
@Repository
public interface ArcTicketMapper extends BaseMapper<ArcTicket> {
    /**
     * 查询工单列表
     * @param wrapper where条件
     * @return
     */
    @Select("select a.*,a.create_user as userId,a.create_user_name as nickName, a.create_user_avatar as avatar from timeline_arc_ticket a left join (select distinct create_user,ticket_id from timeline_arc_data) b on a.ticket_id = b.ticket_id  ${ew.customSqlSegment}")
    List<ArcTicket> selectTicketList(@Param("ew") QueryWrapper wrapper);
}

